<?php
class Application_Form_Search extends Core_Form_BaseForm
{
	
	public  function init()
	{
		$this->addElement('text', 'search_text', array(
			 'decorators' => $this->elementDecorators,
			 'label'       => 'Search',
			 'filters'    => array('StringTrim'),
		));
		
		$this->addElement('submit', 'save',  array(
			 'decorators' => $this->buttonDecorators,
			 'label'        => 'Save',
			 'class'        => 'save-btn',
		));
	}
	/*
	protected $initialVals = array();
	
	public function __construct( $initialVals = array() ) {
		$this->initialVals = $initialVals;
		parent::__construct();
	}
	protected $elementDecorators = array(
		'ViewHelper',
		'Errors',
		array(array('data'  => 'HtmlTag'), array('tag' => 'span', 'class' => 'data-field')),
		array('Label', array('tag' => 'span')),
		array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row-div')),
	);

	protected $buttonDecorators = array(
		'ViewHelper',
		array(array('data' => 'HtmlTag'),  array('tag' => 'span', 'class' => 'data-field')),
		array(array('label' => 'HtmlTag'), array('tag' => 'span',  'placement' => 'prepend')),
		array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row-div')),
	);
        
        protected $attribs = array(
            'class' => 'input-field',
        );

	public  function init()
	{
		$this->addElement('hidden', 'id', array(
			 'decorators' => array('ViewHelper', 'Errors'),
			 'value'		=> '',
			 'attribs'      => $this->attribs,
		));
		$this->addElement('hidden', 'parent_id', array(
			 'decorators' => array('ViewHelper', 'Errors'),
			 'filters'	=> array('StringTrim'),
			 'value'		=> ( !empty ( $this->initialVals['parent_id'] ) ) ? $this->initialVals['parent_id'] : '',
			 'attribs'      => $this->attribs,
		));
		$this->addElement('hidden', 'ajax_callback', array(
			 'decorators' => array('ViewHelper', 'Errors'),
			 'value'		=> 'catalogTree.treeUpdate',
			 'attribs'      => $this->attribs,
		));
		$this->addElement('text', 'title', array(
			 'decorators' => $this->elementDecorators,
			'attribs'      => $this->attribs,
			 'label'       => 'Title',
			 'required' => true,
			 'filters'    => array('StringTrim'),
		));
	       $this->addElement(new Core_Form_Element_Wysiwyg('text', array(
		  'decorators' => $this->elementDecorators,
		  'attribs'      => $this->attribs,
		  'label' => 'Content',
		  'filters' => array('StringTrim')
	       )));
		$this->addElement('submit', 'save',  array(
			 'decorators' => $this->buttonDecorators,
			 'label'        => 'Save',
			 'class'        => 'save-btn',
		));
	}

	public  function loadDefaultDecorators()
	{
		$this->setDecorators(array(
			 'FormElements',
			 array('HtmlTag', array('tag' => 'div', 'class' => 'form-div')),
			 'Form',
		));
	}

*/
}
